package com.han.combination;

/**
 * @ClassName MenuItem
 * @Description 菜单项类:叶子节点
 * @Author duoduo Han
 * @Date 2024/6/13 9:42
 */
public class MenuItem extends MenuComponent {
    public MenuItem(String name, int level) {
        this.name = name;
        this.level = level;
    }

    @Override
    public void print() {
        for (int i = 0; i < level; i++) {
            System.out.print(" ");
        }
        System.out.println(name);

    }
}
